package com.qingcloud.fexecutor.base.enums;

/**
 * 数据集操作类型枚举.
 *
 * @author wangjinnan
 */
public enum CollectionOperateTypeEnum {

    ADD(1, "添加"),
    MODIFY(2, "修改"),
    DELETE(3, "删除"),
    DETAIL(4, "查询详情"),
    QUERY(5, "搜索");

    /**
     * 类型编码
     */
    public final Integer code;
    public final String desc;

    CollectionOperateTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDesc(Integer code) {
        for (CollectionOperateTypeEnum it : CollectionOperateTypeEnum.values()) {
            if (it.code.equals(code)) {
                return it.desc;
            }
        }
        return "";
    }

}
